/**
 * 项目：ystree
 * 模块：测试支持
 * 作者：yangjianliang
 * 日期：2007-6-26
 */
package net.ysen.tree.test;

import java.util.ArrayList;
import java.util.List;

import net.ysen.tree.entitybean.TreeNode;
import net.ysen.tree.impl.YstreeLightImpl;

public class ExampleTreeSupport extends YstreeLightImpl {

	/* (non-Javadoc)
	 * @see net.ysen.tree.abst.TreeAbstract#TreeBeanConversion(java.util.List)
	 */
	@Override
	public List<TreeNode> treeBeanConversion(List list) {
		return list;
	}

	public static List<TreeNode> QueryDepartData(){

		List<TreeNode> list = new ArrayList<TreeNode>();
		TreeNode tree = new TreeNode();
		tree.setId("000");
		tree.setParentid("");
		tree.setText("全国");
		list.add(tree);
		
		TreeNode son01 = new TreeNode();
		son01.setId("000001");
		son01.setParentid( tree.getId() );
		son01.setText("江苏");
		son01.setValue("000001");
		list.add(son01);
		
		TreeNode son02 = new TreeNode();
		son02.setId("000002");
		son02.setParentid( tree.getId() );
		son02.setText("浙江");
		list.add(son02);
		
		TreeNode son03 = new TreeNode();
		son03.setId("000001001");
		son03.setParentid( son01.getId() );
		son03.setText("南京");

		list.add(son03);

		TreeNode son031 = new TreeNode();
		son031.setId("000001001001");
		son031.setParentid( son03.getId() );
		son031.setText("江宁");

		list.add(son031);
		
		TreeNode son04 = new TreeNode();
		son04.setId("000001002");
		son04.setParentid( son01.getId() );
		son04.setParentid(son01.getId());
		son04.setText("苏州");

		list.add(son04);

		TreeNode son05 = new TreeNode();
		son05.setId("000002001");
		son05.setParentid( son02.getId() );
		son05.setText("杭州");

		list.add(son05);

		TreeNode son06 = new TreeNode();
		son06.setId("000002002");
		son06.setParentid( son02.getId() );
		son06.setText("杭州2");

		list.add(son06);
		
		son01.setExpandNode(false);
		tree.setExpandNode(true);
		tree.setExpandNode(true);

		return list;
	}
}
